#!/usr/bin/python
import os
import sys
import string
import db

def isDigtal(Num):
    nums = string.digits
    myNum = str(Num)
    if type(myNum) is not str:
        return False
    else:
        for temp in myNum:
            if temp not in nums:
                return False
        return True


def getVmTypeList():
    connect=db.connectDB()
    conn=db.cursorDB(connect)
    # -1: database connection fail.
    if not conn:
       return -1
    
    cnt1, rows1 = db.exeFetchCommand(conn,"select vm_id, cpu, mem from vm_info where vm_type='master'")
    print rows1
    cnt2, rows2 = db.exeFetchCommand(conn,"select vm_id, cpu, mem from vm_info where vm_type='salve'")
    print rows2
    return rows1,rows2
if __name__ == "__main__":
    getVmTypeList()
